package practice3.persistence;


public class MyAction {
	
	MyService myService;
	
	public void setMyService(MyService service) {
		this.myService = service;
	}
	
	public void execute() throws Exception{
		User u = new User();
//		u.setId("1234");
		u.setName("Mikasa Ackerman");
		myService.addUser(u);
		myService.getUsers();
	}
	
	public void getUsers() throws Exception{
		myService.getUsers();
	}
	
	public User getUser(String id) throws Exception{
		return myService.getUserById(id);
	}
	
	public void txAdd(User u) throws Exception{
			myService.addUserEx(u);
	}
}
